#include <iostream>
#include "Date.h"

using namespace std;

Date::Date(int y, int m, int d){
    setYear(y);
    setMonth(m);
    setDay(d);
}

int Date::getYear() {
    return year;
}

int Date::getMonth() {
    return month;
}

int Date::getDay() {
    return day;
}

void Date::setYear(int y) {
    year = y > 0 ? y:2009;
}

void Date::setMonth(int m) {
    month = (m > 0 && m < 13) ? m:1;
}

void Date::setDay(int d) {
    day = (d >0 && d<32) ? d:1;
}

void Date::displayDate() {
	cout << month << "/" << day << "/" << year << endl;
}


ostream & operator<< (ostream & os, Date & time)
{
	os << time.month << "/" << time.day << "/" << time.year;
	return os;
}